/*
 * rficonsole_stm32.h
 *
 *  Created on: Dec 4, 2012
 *      Author: andrey
 */

/**
 * USART2_TX
 *   PD5
 * USART2_RX
 *   PD6
 * USART2_CK
 *   PD7
 *
 * USART3_TX
 *   PB10, AF7
 *   PD8, AF7
 * USART3_RX
 *   PB11, AF7
 *   PC11, AF7
 *   PD9, AF7
 * USART3_CK
 *   PB12, AF7
 *   PD10, AF7
 *
 *
 */

#ifndef RFICONSOLE_STM32_H_
#define RFICONSOLE_STM32_H_

#define CONSOLE_USART						USART3
#define CONSOLE_IRQHANDLER					USART3_IRQHandler
#define CONSOLE_IRQn					USART3_IRQn

#define CONSOLE_CLK                    RCC_APB1Periph_USART3
#define CONSOLE_TX_GPIO_CLK            RCC_AHB1Periph_GPIOB
#define CONSOLE_RX_GPIO_PORT           GPIOB
#define CONSOLE_RX_GPIO_CLK            RCC_AHB1Periph_GPIOB

void enableSTM32console();
void stmPutCh(int ch);

char* getStmConsoleLine();
int hasStmConsoleLine();
void clearConsoleLine();

#endif /* RFICONSOLE_STM32_H_ */
